HardClipA hard-clipping distortion effector that abruptly clips the signal once it crosses a driven threshold, producing an aggressive, buzzy distortion character.
Extends Effector.
import { HardClip } from "@fluex/fluexgl-dsp";
const hardClip = new HardClip({
drive: 2,
gain: 0.8
});
...
channel.addEffect(hardClip);
new HardClip(options?: HardClipOptions): HardClip;
options?: HardClipOptions
Optional hard-clip configuration (drive, gain, strictMode). Missing or non-finite fields fall back to the class defaults below; drive and gain are floored at 0.label: string | nullCustom label for this effector. Defaults to "HardClip".
name: stringInternal name for this effector. Defaults to "HardClip".
drive: numberAmount of drive applied before clipping. Defaults to 1.
gain: numberOutput gain applied after clipping. Defaults to 1.
strictMode: StrictModeValidation mode passed through to the processor. Defaults to StrictMode.Disabled.
initializeOnAttachment(context: AudioContext): Promise<void>Initializes the effect by creating the AudioWorklet processor node (HardClipProcessor) with the current option values.
context: AudioContextPromise<void>returnOptionsAsObject(): HardClipOptionsReturns a plain object snapshot of the current drive, gain and strictMode values.
setDrive(drive: number): booleanUpdates drive (floored at 0) and forwards the change to the AudioWorklet processor.
drive: numberbooleansetGain(gain: number): booleanUpdates gain (floored at 0) and forwards the change to the AudioWorklet processor.
gain: numberbooleanInherited from Effector (incoming-processor-message, incoming-processor-warning, incoming-processor-error, processor-wasm-instantiated).
This class does not define public getters or setters.